{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\FEVS_2013.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}17 Jun 2021, 23:07:46

{com}. import delimited "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\FEVS\FEVS_2010-2019\FEVS2013_PRDF.csv"
{res}{text}(99 vars, 376,577 obs)

{com}. svyset [pweight=postwt]

      {txt}pweight:{col 16}{res}postwt
          {txt}VCE:{col 16}{res}linearized
  {txt}Single unit:{col 16}{res}missing
     {txt}Strata 1:{col 16}<one>
         SU 1:{col 16}<observations>
        FPC 1:{col 16}<zero>
{p2colreset}{...}

{com}. 
. 
. 
. 
. 
. drop if q17=="X"
{txt}(16,155 observations deleted)

{com}. 
. drop if q17==""
{txt}(2,733 observations deleted)

{com}. 
. drop if q37=="X"
{txt}(16,043 observations deleted)

{com}. 
. drop if q37==""
{txt}(8,728 observations deleted)

{com}. 
. drop if q38=="X"
{txt}(15,349 observations deleted)

{com}. 
. drop if q38==""
{txt}(2,886 observations deleted)

{com}. 
. drop if q15=="X"
{txt}(2,816 observations deleted)

{com}. 
. drop if q15==""
{txt}(1,138 observations deleted)

{com}. 
. drop if q22=="X"
{txt}(11,726 observations deleted)

{com}. 
. drop if q22==""
{txt}(2,095 observations deleted)

{com}. 
. drop if q25=="X"
{txt}(6,737 observations deleted)

{com}. 
. drop if q25==""
{txt}(1,381 observations deleted)

{com}. 
. drop if q33=="X"
{txt}(5,868 observations deleted)

{com}. 
. drop if q33==""
{txt}(2,449 observations deleted)

{com}. 
. drop if q48==.
{txt}(2,970 observations deleted)

{com}. 
. drop if q49==.
{txt}(998 observations deleted)

{com}. 
. 
. 
. destring q17, replace
{txt}q17: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q37, replace
{txt}q37: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q38, replace
{txt}q38: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q15, replace
{txt}q15: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q22, replace
{txt}q22: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q25, replace
{txt}q25: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q33, replace
{txt}q33: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. 
. 
. svy linearized : sem (JUSTICE -> DISTRIBUTIVE, ) (JUSTICE -> PROCEDURAL, ) (JUSTICE -> INTERPERSONAL, ) (DISTRIBUTIVE -> q22, ) (DISTRIBUTIVE -> q25, ) (DISTRIBUTIVE -> q33, ) (PROCEDURAL -> q15, ) (PROCEDURAL -> q17, ) (PROCEDURAL -> q37, ) (PROCEDURAL -> q38, )(INTERPERSONAL -> q48, ) (INTERPERSONAL -> q49, ), standardized latent(JUSTICE DISTRIBUTIVE PROCEDURAL INTERPERSONAL ) nocapslatent
{txt}(running sem on estimation sample)
{res}
{txt}{col 1}Survey: Structural equation model{col 49}Number of obs{col 67}= {res}   276,505
{txt}{col 1}Number of strata{col 22}= {res}        1{txt}{col 49}Population size{col 67}={res}  1,317,576
{txt}{col 1}Number of PSUs{col 22}= {res}  276,505{txt}{col 49}Design df{col 67}= {res}   276,504

{p 0 7}{space 1}{text:( 1)}{space 1} [q22]DISTRIBUTIVE = 1{p_end}
{p 0 7}{space 1}{text:( 2)}{space 1} [q15]PROCEDURAL = 1{p_end}
{p 0 7}{space 1}{text:( 3)}{space 1} [q48]INTERPERSONAL = 1{p_end}
{p 0 7}{space 1}{text:( 4)}{space 1} [DISTRIBUTIVE]JUSTICE = 1{p_end}
{txt}{hline 20}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 21}{c |}{col 33}  Linearized
{col 1}       Standardized{col 21}{c |}      Coef.{col 33}   Std. Err.{col 45}      t{col 53}   P>|t|{col 61}     [95% Con{col 74}f. Interval]
{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Structural         {col 21}{txt}{c |}
{space 2}{col 3}DISTRIBUTIVE     {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .8344772{col 33}{space 2} .0018322{col 44}{space 1}  455.45{col 53}{space 3}0.000{col 61}{space 4} .8308861{col 74}{space 3} .8380682
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}PROCEDURAL       {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .9820324{col 33}{space 2} .0018899{col 44}{space 1}  519.63{col 53}{space 3}0.000{col 61}{space 4} .9783283{col 74}{space 3} .9857365
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}INTERPERSONAL    {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2}  .699804{col 33}{space 2} .0020698{col 44}{space 1}  338.10{col 53}{space 3}0.000{col 61}{space 4} .6957473{col 74}{space 3} .7038607
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Measurement        {col 21}{txt}{c |}
{space 2}{col 3}q22              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8410191{col 33}{space 2} .0013019{col 44}{space 1}  645.99{col 53}{space 3}0.000{col 61}{space 4} .8384674{col 74}{space 3} .8435708
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.348963{col 33}{space 2} .0043493{col 44}{space 1}  540.08{col 53}{space 3}0.000{col 61}{space 4} 2.340439{col 74}{space 3} 2.357488
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q25              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8241889{col 33}{space 2} .0014018{col 44}{space 1}  587.94{col 53}{space 3}0.000{col 61}{space 4} .8214413{col 74}{space 3} .8269364
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.406104{col 33}{space 2} .0046051{col 44}{space 1}  522.49{col 53}{space 3}0.000{col 61}{space 4} 2.397078{col 74}{space 3} 2.415129
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q33              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .6978647{col 33}{space 2} .0017895{col 44}{space 1}  389.99{col 53}{space 3}0.000{col 61}{space 4} .6943574{col 74}{space 3}  .701372
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.115391{col 33}{space 2} .0034302{col 44}{space 1}  616.69{col 53}{space 3}0.000{col 61}{space 4} 2.108668{col 74}{space 3} 2.122114
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q15              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .6085546{col 33}{space 2} .0024359{col 44}{space 1}  249.82{col 53}{space 3}0.000{col 61}{space 4} .6037802{col 74}{space 3}  .613329
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.213336{col 33}{space 2} .0081145{col 44}{space 1}  396.00{col 53}{space 3}0.000{col 61}{space 4} 3.197432{col 74}{space 3} 3.229241
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q17              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .7479022{col 33}{space 2} .0017712{col 44}{space 1}  422.27{col 53}{space 3}0.000{col 61}{space 4} .7444308{col 74}{space 3} .7513736
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.911364{col 33}{space 2} .0067895{col 44}{space 1}  428.80{col 53}{space 3}0.000{col 61}{space 4} 2.898057{col 74}{space 3} 2.924671
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q37              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8265409{col 33}{space 2} .0014899{col 44}{space 1}  554.76{col 53}{space 3}0.000{col 61}{space 4} .8236208{col 74}{space 3} .8294611
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.658744{col 33}{space 2}  .005741{col 44}{space 1}  463.11{col 53}{space 3}0.000{col 61}{space 4} 2.647491{col 74}{space 3} 2.669996
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q38              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8096993{col 33}{space 2} .0016235{col 44}{space 1}  498.75{col 53}{space 3}0.000{col 61}{space 4} .8065174{col 74}{space 3} .8128813
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.242134{col 33}{space 2} .0083033{col 44}{space 1}  390.46{col 53}{space 3}0.000{col 61}{space 4}  3.22586{col 74}{space 3} 3.258408
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q48              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9329532{col 33}{space 2} .0011335{col 44}{space 1}  823.06{col 53}{space 3}0.000{col 61}{space 4} .9307316{col 74}{space 3} .9351749
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.670859{col 33}{space 2} .0097463{col 44}{space 1}  376.64{col 53}{space 3}0.000{col 61}{space 4} 3.651757{col 74}{space 3} 3.689962
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q49              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9124125{col 33}{space 2} .0012191{col 44}{space 1}  748.42{col 53}{space 3}0.000{col 61}{space 4} .9100231{col 74}{space 3} .9148019
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.961521{col 33}{space 2} .0114919{col 44}{space 1}  344.72{col 53}{space 3}0.000{col 61}{space 4} 3.938997{col 74}{space 3} 3.984045
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 10}var(e.q22){c |}{col 21}{res}{space 2} .2926868{col 33}{space 2} .0021899{col 61}{space 4} .2884261{col 74}{space 3} .2970105
{txt}{space 10}var(e.q25){c |}{col 21}{res}{space 2} .3207127{col 33}{space 2} .0023107{col 61}{space 4} .3162155{col 74}{space 3} .3252738
{txt}{space 10}var(e.q33){c |}{col 21}{res}{space 2} .5129848{col 33}{space 2} .0024976{col 61}{space 4} .5081128{col 74}{space 3} .5179035
{txt}{space 10}var(e.q15){c |}{col 21}{res}{space 2} .6296613{col 33}{space 2} .0029648{col 61}{space 4} .6238771{col 74}{space 3} .6354991
{txt}{space 10}var(e.q17){c |}{col 21}{res}{space 2} .4406423{col 33}{space 2} .0026493{col 61}{space 4} .4354802{col 74}{space 3} .4458656
{txt}{space 10}var(e.q37){c |}{col 21}{res}{space 2} .3168301{col 33}{space 2} .0024629{col 61}{space 4} .3120393{col 74}{space 3} .3216943
{txt}{space 10}var(e.q38){c |}{col 21}{res}{space 2}  .344387{col 33}{space 2}  .002629{col 61}{space 4} .3392725{col 74}{space 3} .3495785
{txt}{space 10}var(e.q48){c |}{col 21}{res}{space 2} .1295983{col 33}{space 2}  .002115{col 61}{space 4} .1255185{col 74}{space 3} .1338107
{txt}{space 10}var(e.q49){c |}{col 21}{res}{space 2} .1675034{col 33}{space 2} .0022247{col 61}{space 4} .1631994{col 74}{space 3} .1719209
{txt}{space 1}var(e.DISTRIBUTIVE){c |}{col 21}{res}{space 2} .3036478{col 33}{space 2} .0030579{col 61}{space 4} .2977133{col 74}{space 3} .3097007
{txt}{space 3}var(e.PROCEDURAL){c |}{col 21}{res}{space 2} .0356124{col 33}{space 2} .0037118{col 61}{space 4} .0290323{col 74}{space 3} .0436839
{txt}var(e.INTERPERSONAL){c |}{col 21}{res}{space 2} .5102744{col 33}{space 2} .0028969{col 61}{space 4}  .504628{col 74}{space 3} .5159839
{txt}{space 8}var(JUSTICE){c |}{col 21}{res}{space 2}        1{col 33}{space 2}        .{col 61}{space 4}        .{col 74}{space 3}        .
{txt}{hline 20}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. 
. 
. estat gof, stats(all)
{res}
{txt}{hline 21}{c TT}{hline 54}
{lalign 21:Fit statistic}{c |}      Value   Description
{hline 21}{c +}{hline 54}
{lalign 21:Size of residuals}{c |}
{ralign 20:SRMR} {c |} {res}{ralign 10:     0.041}{txt}   Standardized root mean squared residual
{ralign 20:CD} {c |} {res}{ralign 10:     0.968}{txt}   Coefficient of determination
{hline 21}{c BT}{hline 54}
{p 0 2 2 75}Note: model was fit with{txt} svy: prefix; only stats(residuals) valid.{p_end}

{com}. predict justice, latent(JUSTICE)
{res}
{com}. 
. 
. 
. egen average_justice = mean (justice), by (agency)

. 
. egen sub1_average_justice = mean (justice), by (plevel1)

. 
. 
. 
. egen sub2_average_justice = mean (justice), by (plevel2)

. save "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2013FEVS_Justice.dta"
{txt}file C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2013FEVS_Justice.dta saved

{com}. exit, clear
